fix: add xmlns:xhtml to sitemap#6920
Conversation
🦋 Changeset detectedLatest commit: 82841c7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds the XHTML namespace declaration ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bundle Size Benchmarks
Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/start-plugin-core/src/build-sitemap.ts (1)
202-209:⚠️ Potential issue | 🟠 MajorThe
xhtmlnamespace fix is correct, butimage:andnews:namespaces are also missing.The added
xmlns:xhtmldeclaration properly resolves the reported validation error forxhtml:linkelements. However, the code also usesimage:image(line 98) andnews:news(line 111) prefixes without declaring their namespaces, which will cause identical validation errors when those features are used.🔧 Proposed fix to add all required namespace declarations
function createXml(elementName: 'urlset' | 'sitemapindex'): XMLBuilder { return create({ version: '1.0', encoding: 'UTF-8' }) .ele(elementName, { xmlns: 'https://www.sitemaps.org/schemas/sitemap/0.9', 'xmlns:xhtml': 'http://www.w3.org/1999/xhtml', + 'xmlns:image': 'http://www.google.com/schemas/sitemap-image/1.1', + 'xmlns:news': 'http://www.google.com/schemas/sitemap-news/0.9', }) .com(`This file was automatically generated by TanStack Start.`) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/start-plugin-core/src/build-sitemap.ts` around lines 202 - 209, The createXml function currently adds only xmlns and xmlns:xhtml but omits the image and news namespaces used elsewhere; update the element attributes in createXml (the ele call that takes elementName) to also include xmlns:image with "http://www.google.com/schemas/sitemap-image/1.1" and xmlns:news with "http://www.google.com/schemas/sitemap-news/0.9" so that image:image and news:news prefixed elements validate correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/start-plugin-core/src/build-sitemap.ts`:
- Around line 202-209: The createXml function currently adds only xmlns and
xmlns:xhtml but omits the image and news namespaces used elsewhere; update the
element attributes in createXml (the ele call that takes elementName) to also
include xmlns:image with "http://www.google.com/schemas/sitemap-image/1.1" and
xmlns:news with "http://www.google.com/schemas/sitemap-news/0.9" so that
image:image and news:news prefixed elements validate correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f18b2fc0-f3a1-4e2f-af34-b1a44a4eb5ce
📒 Files selected for processing (1)
packages/start-plugin-core/src/build-sitemap.ts
340e714 to
543d4cb
Compare
|
View your CI Pipeline Execution ↗ for commit 82841c7
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/public-spoons-find.md:
- Line 8: Replace the incorrect namespace prefix `xmlns:html` with the correct
`xmlns:xhtml` in the changelog entry: locate the string `xmlns:html` in the
changelog text and change it to `xmlns:xhtml` so the generated sitemap namespace
is accurate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0a7cd455-b118-41a4-a6f9-64a343b05ab1
📒 Files selected for processing (2)
.changeset/public-spoons-find.mdpackages/start-plugin-core/src/build-sitemap.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/start-plugin-core/src/build-sitemap.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Currently the generated sitemap will show an error if you try to validate it:
By adding
to the root of the sitemap it won't show any validation errors anymore
Summary by CodeRabbit